
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 0785
 * @Author : WangRuoyu 
 * @Date : 2023/5/20 10:01
 */

#include "iostream"

using namespace std;

void quick_sort(int a[], int l, int r) {
    if (l >= r) return;

    int x = a[l + r >> 1];
    int i = l - 1;
    int j = r + 1;
    while (i < j) {
        while (a[++i] < x);
        while (a[--j] > x);
        if (i < j) {
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    quick_sort(a, l, j);
    quick_sort(a, j + 1, r);

}

int main() {
    int n;
    scanf("%d", &n);
    int a[n];
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
    }
    quick_sort(a, 0, n - 1);
    for (int i = 0; i < n; ++i) {
        printf("%d ", a[i]);
    }
    return 0;
}